<template>
	<view class="mainpadding">
		<!--账号申诉理由-->
		<u-popup :show="show" :round="10" mode="center" @close="close">
			<view class="mainpadding">
				<view class="titletext textcenter">账号申诉理由</view>
				<textarea class="textareas margin_top2" rows="10" maxlength="100" placeholder="请输入申诉理由" v-model="ssly"></textarea>
			</view>
			<view class="flexbetween">
				<view class="qxbtn" @click="close">取消</view>
				<view class="hfbtn" @click="fjyy">确认</view>
			</view>
		</u-popup>
		<view class="titletext">封禁原因</view>
		<view class="u-content">
			<!-- <u-parse :content="content"></u-parse> -->
			<text class="fjreson">{{black.reason}}</text>
		</view>
		<!-- 底部 -->
		<view class="dibuboxs" @click="shensu">
			<view class="dibubtn">申诉</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				black:{},
				ssly:'',
				show: false,
				content: `
									<p>露从今夜白，月是故乡明</p>
									<img src="https://cdn.uviewui.com/uview/swiper/2.jpg" />
								`
			}
		},
		onShow() {
			this.mypage();
		},
		methods: {
			// 我的页面个人信息
			mypage() {
				httpRequest.request('user/index', 'POST', {}, false, false, true).then(res => {
					console.log(res);
					this.black = res.data.userinfo.black;
				})
			},
			fjyy(){
				if(this.ssly == ''){
					httpRequest.toast('请输入账号申诉理由!')
					return false;
				}
				httpRequest.request('user/appeal','POST',{
					appeal:this.ssly,
					black_id:this.black.id,
				}).then(res => {
					if(res.code == 1){
						httpRequest.toast('申诉成功，请等待审核!')
						this.show = false;
					}
				})
			},
			close() {
				this.show = false
			},
			shensu() {
				this.show = true
			},
		}
	}
</script>

<style lang="scss" scoped>
	.fjreson{
		font-size: 26rpx;
		letter-spacing: 4rpx;
	}
	.titletext{
		text-align: center;
		font-size: 36rpx;
	}
	.textareas{
		height: 184rpx;
		background: #FAFAFA;
		border-radius: 20rpx;
		padding: 30rpx;
	}
.qxbtn {
		border-right: none !important;
		border: 1rpx solid rgba(153, 153, 153, .5);
		border-radius: 0 0 0 20rpx;
		width: 50%;
		font-size: 36rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #999999;
		padding: 40rpx 0;
		text-align: center;
	}

	.hfbtn {
		border: 1rpx solid rgba(153, 153, 153, .3);
		border-radius: 0 0 20 0rpx;
		width: 50%;
		font-size: 36rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #3ACFA3;
		padding: 40rpx 0;
		text-align: center;
	}

	/deep/.u-popup__content {
		// width: 90%;
		padding-bottom: 0 !important;
	}

	/deep/.u-safe-area-inset-bottom {
		padding-bottom: 0 !important;
	}

</style>
